#ifndef PLAYTOOLBAR_H
#define PLAYTOOLBAR_H

#include <QWidget>

namespace Ui {
class playToolBar;
}

class xh_AVCodecControler;
class playToolBar : public QWidget
{
    Q_OBJECT

public:
    explicit playToolBar(QWidget *parent = nullptr);
    ~playToolBar();

    void setDuration(uint64_t duration);
    void setCurrentTimeStamp(uint64_t timeStamp);

    void setAVCodecControler(xh_AVCodecControler* controler);

    bool isMuted();

private slots:
    void on_pushButton_play_clicked(bool checked);

    void on_horizontalSlider_sliderPressed();

    void on_horizontalSlider_sliderReleased();

    void on_pushButton_volume_clicked(bool checked);

    void on_pushButton_fullScreen_clicked(bool checked);

signals:
    void fullScreen(bool);

private:
    QString convertSecond(uint64_t second);

    Ui::playToolBar *ui;

    uint64_t m_duration = 0;
    uint64_t m_timeStamp = 0;

    xh_AVCodecControler *m_controler = nullptr;

    bool m_isPressed = false;
};

#endif // PLAYTOOLBAR_H
